fix: support @ngx-translate/core v18#736
Open
artaommahe wants to merge 1 commit into
Open
Conversation
ngx-translate v18 removed the `TranslateModule` NgModule. The library's 9 feature modules imported it solely to make the `translate` pipe and directive available in their templates, which breaks consumers on v18 with "No matching export ... for import 'TranslateModule'". Replace `TranslateModule` with the standalone `TranslatePipe` and `TranslateDirective` in each module's `imports`. These have been standalone since @ngx-translate/core v15, so the change is backward compatible with v17. No `TranslateService` usage changes are needed — the library already uses the v18-era `getFallbackLang()` / `setFallbackLang()` API. Widen the peer dependency to `^17.0.0 || ^18.0.0`. Closes GetStream#735 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
@ngx-translate/corev18 removed theTranslateModuleNgModule. stream-chat-angular's feature modules import it, so any consumer on v18 fails to build with:(Reported in #735 — Angular 21 + @ngx-translate/core 18.)
Fix
The 9 feature modules imported
TranslateModuleonly to expose thetranslatepipe/directive in their templates. This replaces it with the standaloneTranslatePipeandTranslateDirectivein eachimportsarray. These have been standalone since@ngx-translate/corev15, so the change is backward compatible with v17.The peer dependency is widened to
^17.0.0 || ^18.0.0.No
TranslateServicechanges are needed — the code already uses the v18-eragetFallbackLang()/setFallbackLang()API.Testing
ng build stream-chat-angularpasses against both@ngx-translate/core@17and@ngx-translate/core@18, and the built bundle no longer importsTranslateModule(it now importsTranslateDirective, TranslatePipe). Existing specs are unchanged.Closes #735